<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IMS Login</title>
</head>
<body>

<h3>Please Login:</h3>

<% 	//checks for a failed login and displays failed message. 

	try {
		String lgnStatus = request.getParameter("status"); 
		if (lgnStatus.equals("failed")) {
			out.println("<div style='color:red'><p>Incorrect user name or password.</div>Please try again or create an account.</p>");
		} 
	}
	catch(NullPointerException e) {
		//do nothing 
	}
	
%>

<form method=post action="Authenticate">
<table cellpadding='3'>
<tr><td>User Name: </td><td><input type="text" name=username size=10></td></tr>
<tr><td>Password: </td><td><input type="password" name=password size=10></td></tr>
</table>
<div name=action id='action' value=0></div>
<p><input type=SUBMIT name=submit value="Submit">&nbsp&nbsp<input type=SUBMIT name=submit value="Register"></p>
</form>

</body>
</html>